package com.customer.util;

import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.Serializable;

/**
 * 2 * @Author: xy
 * 3 * @Date: 2021/10/11 下午 11:04:49
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:redis.xml")
public class RedisTest implements Serializable {

    @Test
    public void testRedisPool() {
        RedisUtils.getJedis().set("xiaomin", RandomStringUtils.randomNumeric(6));
        System.out.println(RedisUtils.getJedis().get("xiaomin"));
    }

    @Autowired
    private RedisService2 redisService2;

    @Test
    public void testRedisService() {
        Boolean b = redisService2.set("lisi", "1223");
        System.out.println(b);
    }

    @Test
    public void testRedisService2() {
        System.out.println(redisService2.hmget("verification"));


    }
}
